home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
fade
/
readme.txt
< prev
Wrap
Text File
|
1992-12-09
|
2KB
|
51 lines
==========================
FADE TO BLACK - Fade.Mak
==========================
This sample project demonstrates how to make the background of
your form fade from blue to black. It was designed to replicate
(as near as possible) the Setup forms used by Microsoft and
most other major software publishers.
The theory is simple -
1. Divide the form into 63 regions
2. Create a SolidBrush that starts out as solid blue,
i.e. RGB value of 0, 0, 255
(Create brush with API call CreateSolidBrush)
3. Fill the first region of the form with the solid
blue brush (with API call FillRect)
4. Destroy the first brush (with API call DeleteOBject)
and create a second brush that has a little less blue
(0, 0, 251)
5. Fill the second region of the form with the
slightly less blue brush
6. Repeat steps 4 and 5 until form is filled. The
last brush is pure black (0, 0, 0).
Although it sounds like it would take a long time to fill 63 regions
with different brushes, it actually works very fast.
To add this to your own project, just add the file Fade.bas to your
project and put the following calls in your Form_Paint and Form_Resize
events:
FadeForm Me
NOTE: I tried to do the same thing using VB's Line method, but it
insisted on drawing the outline of each box. This looked very ugly.
SECOND NOTE: The enclosed files were saved as text files under VB2.
Although they cannot be loaded directly into VB1, the primary file
(Fade.bas) can be imported into a VB1 module or it can be viewed with
Notepad or any other text editor.
Enjoy!
Brian Stine
CS ID 73617,323